<?php
require_once dirname(__FILE__).'/../../bannerCycleWidget/actions/components.class.php';


class newsCarouselWidgetComponents extends bannerCycleWidgetComponents{

    public function executeRender(){



		$q = NewItemTable::getStructureNewsByIdQuery($this->getRoute()->getObject());
		$q->andWhere('ni.picture != ""')
				->orderBy('ni.pri desc');
		NewItemTable::commonActivityConstraints($q);

		$this->section = $this->getRoute()->getObject();

		$this->news = NewItemTable::normalizeAssociatedNews($q);
		if($this->news)
			$this->news = $this->news[0]['news'];



		// get introduction
		$wq = StructureTable::getNodeChildrenQuery($this->section);
		$wq->andWhere('parameter = ?', 'introduction');

		$this->welcome = $wq->execute()->getFirst();
		

    }

}